<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>系统登录</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Arial', sans-serif;
        }

        body {
            background-color: #f5f5f5;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }

        .login-container {
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
            padding: 40px;
            width: 400px;
            text-align: center;
        }

        .logo {
            margin-bottom: 30px;
        }

        .logo img {
            width: 80px;
            height: 80px;
        }

        h1 {
            color: #333;
            margin-bottom: 30px;
            font-size: 24px;
        }

        .role-selector {
            display: flex;
            justify-content: center;
            margin-bottom: 20px;
        }

        .role-btn {
            padding: 10px 20px;
            border: none;
            background-color: #eee;
            color: #666;
            cursor: pointer;
            font-size: 16px;
            transition: all 0.3s;
        }

        .role-btn:first-child {
            border-radius: 5px 0 0 5px;
        }

        .role-btn:last-child {
            border-radius: 0 5px 5px 0;
        }

        .role-btn.active {
            background-color: #4285f4;
            color: white;
        }

        .form-group {
            margin-bottom: 20px;
            text-align: left;
        }

        label {
            display: block;
            margin-bottom: 8px;
            color: #555;
            font-weight: bold;
        }

        input {
            width: 100%;
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 16px;
        }

        input:focus {
            outline: none;
            border-color: #4285f4;
        }

        .login-btn {
            width: 100%;
            padding: 12px;
            background-color: #4285f4;
            color: white;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        .login-btn:hover {
            background-color: #3367d6;
        }

        .forgot-pwd {
            margin-top: 15px;
            text-align: center;
        }

        .forgot-pwd a {
            color: #666;
            text-decoration: none;
            font-size: 14px;
        }

        .forgot-pwd a:hover {
            color: #4285f4;
        }
    </style>
</head>
<body>
<div class="login-container">
    <div class="logo">
        <img src="https://via.placeholder.com/80" alt="Logo">
    </div>
    <h1>欢迎登录</h1>

    <div class="role-selector">
        <button class="role-btn active" id="user-btn">用户登录</button>
        <button class="role-btn" id="admin-btn">管理员登录</button>
    </div>

    <form id="login-form" action="/tourismsystem/login.manager">
        <div class="form-group">
            <label for="username">用户名</label>
            <input type="text" name="username" id="username" placeholder="请输入用户名" required>
        </div>

        <div class="form-group">
            <label for="password">密码</label>
            <input type="password" name="password" id="password" placeholder="请输入密码" required>
        </div>

        <button type="submit" class="login-btn">登录</button>
    </form>

    <div class="forgot-pwd">
        <a href="#">忘记密码?</a>
    </div>
</div>

<script>
    // 角色选择功能
    const userBtn = document.getElementById('user-btn');
    const adminBtn = document.getElementById('admin-btn');
    let currentRole = 'user'; // 默认用户登录

    userBtn.addEventListener('click', function() {
        userBtn.classList.add('active');
        adminBtn.classList.remove('active');
        currentRole = 'user';
    });

    adminBtn.addEventListener('click', function() {
        adminBtn.classList.add('active');
        userBtn.classList.remove('active');
        currentRole = 'admin';
    });
</script>
</body>
</html>